import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/login/index.vue';
Vue.use(VueRouter)


const routes = [
  {
    path: '/',
    name: 'login',
    component: index,
  },
  {
    path:'/layout',
    name:"layout",
    redirect:'/layout/index',
    component:()=>import("../views/layout.vue"),
    children:[
      {
        meta: {title: '首页'},
        name:'index',
        path:'/layout/index',
        component:()=>import("../views/home/index.vue")
       },
       {
          meta: {title: '相册管理'},
          name:'image',
          path:'/layout/image', 
          component:()=>import("../views/image/img.vue")
       },		
       {
        meta: {title: '商品管理'},
        name:'shop_goods_list',
        path:'/layout/shop_goods_list', 
        component:()=>import("../views/shop/goods/list.vue")
     },
     {
      meta: {title: '商品分类'},
      name:'shop_category_style',
      path:'/layout/shop_category_style', 
      component:()=>import("../views/shop/category/style.vue")
      },
    ]
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
